import Vue from 'vue'

const drawerNumberInfo = Vue.observable({
  ids: []
})

export function selfAddDrawerNumber (id) {
  if (drawerNumberInfo.ids.includes(id)) {
    return
  }
  drawerNumberInfo.ids.push(id)
}

export function selfSubDrawerNumber (id) {
  let index = drawerNumberInfo.ids.indexOf(id)
  if (index < 0) {
    return
  }
  drawerNumberInfo.ids.splice(index, 1)
}

export function getDrawerNumber () {
  return drawerNumberInfo.ids.length
}
